//
//  BasePopView.m
//  project
//
//  Created by 圆圆陈 on 2017/12/22.
//  Copyright © 2017年 黄建华. All rights reserved.
//

#import "BasePopView.h"

@implementation BasePopView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        self.backgroundColor = UIColorHEXA(0x000000, 0.0);
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTouch)];
        tap.delegate = self;
        [self addGestureRecognizer:tap];
    }
    return self;
}
- (void)tapTouch
{
    [self animationedDown];
}
- (void)animationUp
{
    [UIView animateWithDuration:0.3 animations:^{
        self.backgroundColor = UIColorHEXA(0x000000, 0.4);
    }];
}

- (void)animationedDown
{
    [UIView animateWithDuration:0.3 animations:^{
        self.backgroundColor = UIColorHEXA(0x000000, 0.0);
    } completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
    return YES;
}
@end
